#!/bin/bash

echo "启动 Node.js 后端服务..."
echo

cd backend

echo "检查依赖..."
if [ ! -d "node_modules" ]; then
    echo "安装依赖..."
    npm install
fi

echo
echo "启动后端服务器..."
echo "服务器地址: http://localhost:3002"
echo "健康检查: http://localhost:3002/health"
echo
echo "按 Ctrl+C 停止服务器"
echo

npm run dev 